package com.nowcoder.community.service;

import com.nowcoder.community.pojo.Message;

import java.util.List;
//采用抽象工厂模式，在进行查询操作时，提供了方法的模板，返回值为查询结果
public interface MessageService {

    List<Message> findConversations(int userId, int offset, int limit);

    int statisticsConversationCount(int userId);

    List<Message> findLetters(String conversationId, int offset, int limit);

    int statisticsLetterCount(String conversationId);

    int statisticsLetterUnreadCount(int userId, String conversationId);

    int addMessage(Message message);

    int updateMessageStatus(List<Integer> ids);

    Message findLatestNotice(int userId, String topic);

    int findNoticeCount(int userId, String topic);

    int findNoticeUnreadCount(int userId, String topic);

    List<Message> findNotices(int userId, String topic, int offset, int limit);
}
